package model

import "duoke/tables"

type ReqStaffLogin struct {
	Username string `json:"username" binding:"required" required_err:"请输入手机号"`
	Password string `json:"password" binding:"required" required_err:"请输入登录密码"`
}

// 账户信息保存
type ReqStaff struct {
	Id       int    `json:"id" xorm:"not null pk autoincr INT(10)" `
	Password string `json:"password" binding:"required" required_err:"请输入登录密码"`
	Phone    string `json:"phone" binding:"required,len=11,numeric" required_err:"请输入手机号" len_err:"请输入正确的手机号" numeric_err:"请输入正确的手机号"`
	Name     string `json:"name"`
	Nickname string `json:"nickname"`
	Avatar   string `json:"avatar"`
}

func (ReqStaff) TableName() string {
	return "goods_user"
}

// 员工列表
type StaffList struct {
	tables.GoodsUser `xorm:"extends"`
	OrderNum         int            `json:"order_num" xorm:"-"`
	OrderList        []tables.Order `json:"order_list" xorm:"-"`
	ShareQrcodeUrl   string         `json:"share_qrcode_url" xorm:"-"`
}

func (StaffList) TableName() string {
	return "goods_user"
}
